<template>
	<view class="container">
		<view class="">
			<u-swiper :list="list1" height="800rpx" @change="change" @click="click"></u-swiper>
		</view>
		<view class="xuanfu">
			<view class="diandan">
				<view class="fl_ju">
					<view class="kuang3" @click="go(0)">
						<view class="title">
							到店自取
						</view>
						<view class="txt">
							提前下单,到店立取
						</view>
						<image src="../../static/mendian.png" class="mendian" mode=""></image>

					</view>
					<view class="kuang3" @click="go(1)">
						<view class="title">
							外卖上门
						</view>
						<view class="txt">
							约30分钟送达
						</view>
						<image src="../../static/wm.png" class="waimai" mode=""></image>

					</view>
				</view>
				<view class="fl_ju" style="margin-top: 20rpx;">
					<view class="kuang3 fl_ju" @click="go(2)">
						<view class="title">
							专属礼券
							<view class="tishi">
								领取专属优惠券
							</view>
						</view>
						<image src="../../static/shangcheng.png" class="shangcheng" mode=""></image>
					</view>
					<view class="kuang3 fl_ju" @click="show = true">
						<view class="title">
							扫码进群
							<view class="tishi">
								进群享社区折扣
							</view>
						</view>
						<image src="../../static/vip2.png" class="vip2" mode=""></image>
					</view>
				</view>
				<!-- 		<view class="minlist fl_ju">
					<view class="minbox">
						<view class="son">
							<image src="../../static/icon4.png" mode=""></image>
						</view>
						优惠专享
					</view>
					<view class="minbox">
						<view class="son">
							<image src="../../static/icon3.png" mode=""></image>
						</view>
						我的优惠券
					</view>
						<view class="minbox">
						<view class="son">
							<image src="../../static/icon1.png" mode=""></image>
						</view>
						扫码进群
					</view>
					<view class="minbox">
						<view class="son">
							<image src="../../static/icon2.png" mode=""></image>
						</view>
						联系店长
					</view>
				</view> -->

			</view>

		</view>

		<view class="biaoyu">
			·喝杯睦月 开启快乐每一天·
		</view>
		<view class="yinyin">
		</view>
		<u-popup :show="show" @close="close" :closeOnClickOverlay="true" :round="20" mode="center" @open="open">
			<view class="shequ">
				<view class="">
					扫码加群，点餐更划算
				</view>
				<image src="../../static/erweima.jpg" mode=""></image>
				<view class="">
					欢迎添加老板微信
				</view>
				<view class="" @click="copy" style="font-size: 24rpx;margin-top: 20rpx;">
					yc49994431
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import {
		baseModuleList,
		userInfo
	} from '@/api/url.js'
	export default {
		data() {
			return {
				show: false,
				list1: [],
				token: uni.getStorageSync('token')
			};
		},
		computed: {

		},
		onShow() {

		},
		onLoad() {
			this.list()
			userInfo(this.token).then(res => {
				console.log(res.data.code)
				if (res.data.code == 401) {
					uni.showToast({
						title: '未登录~',
						icon: 'none',
						duration: 10000
					})
					setTimeout(function() {
						uni.hideToast()
						uni.redirectTo({
							url: '/pages/login/login'
						})
					}, 1000)
				}
			})
		},
		methods: {
			list() {
				baseModuleList().then(res => {
					console.log(res)
					for (let i = 0; i < res.data.rows.length; i++) {
						this.list1.push(res.data.rows[i].picture)
					}
				})

			},
			change() {},
			go(e) {
				switch (e) {
					case 0:
						uni.navigateTo({
							url: '/pages/index/orderManagement?type=' + e
						})
						break;
					case 1:
						uni.navigateTo({
							url: '/pages/index/orderManagement?type=' + e
						})
						break;
					case 2:
						uni.navigateTo({
							url: '/pages/index/receive'
						})
						break;
				}
			},
			yhq() {
				uni.navigateTo({
					url: '/pages/index/receive'
				})
			},
			close() {
				this.show = false
			},
			qun() {
				uni.navigateTo({
					url: '/pages/index/receive'
				})
			},
		},
	};
</script>

<style lang="scss" scoped>
	.container {
		position: relative;
		background-color: #fff;
		height: 100vh;
	}

	.shequ {
		border-radius: 40rpx;
		background-color: #fff;
		padding: 32rpx;
		box-sizing: border-box;
		text-align: center;
		font-size: 30rpx;
		font-weight: 600;
		width: 600rpx;
		height: 600rpx;

		image {
			width: 350rpx;
			height: 350rpx;
			margin: 20rpx 0;
		}
	}

	.biaoyu {
		font-size: 34rpx;
		color: #999999;
		text-align: center;
		position: fixed;
		bottom: 50rpx;
		left: 0;
		right: 0;
	}

	.yinyin {
		width: 100%;
		box-shadow: 0rpx 30rpx 30rpx 20rpx #b1b1b1;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
	}

	.minlist {
		padding: 30rpx;
		box-sizing: border-box;
		margin-top: 40rpx;

		.minbox {
			text-align: center;

			.son {
				width: 100rpx;
				height: 100rpx;
				margin: 0 auto;
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
				background: red linear-gradient(to top, #fff, #195af4);
				margin-bottom: 20rpx;

				image {
					width: 70rpx;
					height: 70rpx;

				}
			}
		}
	}

	.xuanfu {
		position: absolute;
		top: 700rpx;
		left: 0;
		right: 0;
		padding: 0 30rpx;
		box-sizing: border-box;
		border-top-right-radius: 50rpx;
		border-top-left-radius: 50rpx;
		background-color: #fff;

		.diandan {
			width: 100%;
			margin-top: -50rpx;
		}

	}

	.xinxi {
		color: #fff;
	}

	.kuang3 {
		text-align: center;
		width: 49%;
		background-color: #fff;
		border-radius: 20rpx;
		padding: 30rpx;
		box-sizing: border-box;
		box-shadow: 0rpx 0rpx 20rpx -10rpx #c6c6c6;

		.shangcheng {
			width: 70rpx;
			height: 70rpx;
		}

		.vip2 {
			width: 95rpx;
			height: 70rpx;
		}

		.mendian {
			width: 102rpx;
			height: 125rpx;
		}

		.waimai {
			width: 171rpx;
			height: 125rpx;
		}


		.title {
			color: #090909;
			font-size: 35rpx;
			font-weight: 600;
		}

		.txt {
			color: #2d5699;
			margin: 15rpx 0 30rpx;
			font-size: 24rpx;
		}
	}

	.tishi {
		margin-top: 10rpx;
		font-size: 24rpx;
		font-weight: 100;
	}
</style>